1. Field of the Invention
This invention relates to an image reading apparatus constituting a copy machine, a scanning processing unit of an MFP (Multi Function Printer) or a single scanner apparatus.
2. Description of the Related Art
In general, for such an image reading apparatus (described above), when the image reading apparatus reads a document, image data read by an image reading unit is first written in a memory, and then a high level processing part or an external device (personal computer or the like) reads the written image data.
In this case, the reason for using the memory is because the image reading speed of the image reading unit does not always match with the reading speed of the high level processing part or the reading speed of the external device. When a sufficient memory size is provided for image data to be read, the image data is continuously written in a predetermined region of the memory, and the high level processing unit or the external device reads the image data from the region of the memory. In this case, any size of image data can be read from a document without interruption of reading image data as long as memory size is not limited.
However, using large capacity memory causes an increase in cost of an apparatus, and thus the memory size used needs to be limited when minimum cost is required to design the apparatus. In that case, the memory writes, like a ring buffer, image data in the memory from a top address of the memory one after another up to an end address of the memory, and then the memory returns to the top address again and continuously writes the image data on which the high level processing unit or the external device has completed reading data so that there is a space region available for writing data.
Also, when the high level processing unit or the external device is delayed, the reading of image data needs to be intermittent to avoid overflowing of the memory because writing image data cannot be performed for the memory region which still includes unread data.
FIG. 1 is a flowchart to show processing in a conventional image reading apparatus. When the apparatus determines that the memory is full (in case, available memory area is insufficient) and further data processing cannot be performed, the reading of image data is interrupted so that the apparatus restarts reading image data when available memory area for writing data is generated after the high level processing unit or the external device have read the unread data. This intermittent data reading technique is indicated in the figure (e.g. see patent document 1, Japanese Patent No. 3701621).
When processing is started by turning on of the power supply of the apparatus in step S1 in FIG. 1, the process waits for an instruction to start reading from the operation panel or the like in step S2 and restarts reading image data operation when receiving instruction to start reading at step S3.
Further, at step S4, the reading of image data (writing image data in the memory) is performed, and at step S5, the process determines whether there is an end of reading position (identically determined by number of lines from the reading start) and if there is no end of reading position, the process determines whether the memory is full at step S6. If the memory is not full, the process continues reading image data in step S4.
If a “memory full” condition has occurred, a reading stop signal is generated in step S7 and the reading of image data is interrupted at step S8. After that, the processing determines at step S9 whether the reading of image data can restart because the memory full is resolved, and if possible, the processing channels (restart the reading of image instructions) the reading stop signal in step S3 and restarts the reading image operation.
Further, when the reading of image data is determined to reach an end of reading position at step S5, the processing stops the reading image data at step S10, and the entire process finishes at step S11.
A conventional image reading apparatus described above performs intermittent control of the reading of image data so as not to generate overflow of memory. However there is a problem in that an overflow of memory may occur for the following reason.
(1) In a conventional intermittent reading technique, when a controlling block of an intermittent command cannot transmit an intermittent operation command (a reading stop signal) for any reason, load increase of CPU, for example, image data to be written in storage device exceeds tolerance of memory, so that overflow of the memory occurs. In that case, the process stops by failed error, and thus the reading operation needs to interrupt.
(2) In a conventional intermittent reading technique, when a “memory full” condition is generated (when it is determined that the following processing cannot be performed), reading of image data is switched to an interruption. If a data delay block occurs between the reading image unit and the memory (when an image processing unit exists, for example), the data delay block may cause memory overflow. Thus, when the data delay block includes data which is larger than an available space area of the memory, new reading of image data is not performed by interruption of the reading of image data, and an overflow of memory is caused by delayed writing data in the memory. Also, when the data delay block is an image processing unit, an enlargement of an image or the like may increase the amount of data by several times, and this increase in the data may enhance the possibility of the overflow of memory.
This invention takes such conventional problems into account. One aspect of the invention provides an image reading apparatus which can avoid overflow of the memory when there is limitation that the memory is smaller than memory size needed for reading image data of one page, enabling the reading of any size of image data.